---@class RedRob.BuffBase
---@field New fun():RedRob.BuffBase
local BuffBase = RedRob.CreateClass("BuffBase")

function BuffBase:OnCreate()
    self.buffId = 0
    self.overlay = 1    --叠加层级
    self.casterId = 0   --施法者id
    self.targetId = 0   --挂载对象
    self.skillId = 0    --哪个技能产生
    self.isInDuring = false
    self.curTime = 0
    self.during = 0     --持续时间
end
function BuffBase:Set(buffId,overlay,targetId,during)
    self.buffId = buffId
    self.overlay = overlay
    self.targetId = targetId
    self.during = during
    self.curTime = 0
end
function BuffBase:SetCasterId(id)
    self.casterId = id
end
function BuffBase:SetSkillId(id)
    self.skillId = id
end
---当buff销毁后(已从buff容器中移除)
function BuffBase:OnDestroy()

end
function BuffBase:Update(dt)
    if self.isInDuring then
        self.curTime = self.curTime + dt
        if self.curTime > self.during then
            self.isInDuring = false
            self:OnBuffRemove()
        end
    end

end
---实例化后，生效前调用(还未加入buff容器中)
function BuffBase:OnBuffAwake()

end
---buff生效时
function BuffBase:OnBuffStart()
    if self.during > 0 then
        self.isInDuring = true
    end
end
---相同类型时刷新(更新buff层数、等级、持续时间等)
function BuffBase:OnBuffRefresh()

end
---当buff销毁前(还未从buff容器中移除)
function BuffBase:OnBuffRemove()

end

---定时器间隔触发开始
function BuffBase:StartIntervalThink()

end
---定时器间隔触发
function BuffBase:OnIntervalThink()

end
